package cn.xueden.system.converter;

import cn.xueden.system.model.dto.UserImportDTO;
import cn.xueden.system.model.entity.User;
import cn.xueden.system.model.form.EditUserForm;
import cn.xueden.system.model.form.UserForm;
import org.mapstruct.Mapper;
import org.springframework.stereotype.Component;

/**功能描述：用户转换器
 * @author:梁志杰
 * @date:2025/6/9
 * @description:cn.xueden.system.converter
 * @version:1.0
 */
@Component
@Mapper(componentModel = "spring")
public interface UserConverter {

    /**
     * 将用户表单对象转换为用户实体对象
     * @param userForm
     * @return
     */
    User fromToEntity(UserForm userForm);

    /**
     * 将用户表单对象转换为用户实体对象
     * @param editUserForm
     * @return
     */
    User editUserForm2User(EditUserForm editUserForm);

    /**
     *
     * @param data
     * @return
     */
    User userImportDTOToEntity(UserImportDTO data);
}
